package com.goodwill.androidtest.notifyItem.adapter;


import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.MultipleItemRvAdapter;
import com.goodwill.androidtest.notifyItem.MultiItemBean;
import com.goodwill.androidtest.notifyItem.provider.EditTextArgumentProvider;
import com.goodwill.androidtest.notifyItem.provider.TextArgumentProvider;


/**
 * @author guoxiaojun
 * @date 2021/6/22 16:42
 * @desc 多条目适配器
 */
public class BRVAHMultiRvAdapter extends MultipleItemRvAdapter<MultiItemBean, BaseViewHolder> {
    private TextArgumentProvider mTextArgumentProvider;
    private EditTextArgumentProvider mEditTextArgumentProvider;

    public BRVAHMultiRvAdapter() {
        super(null);
        mTextArgumentProvider = new TextArgumentProvider();
        mEditTextArgumentProvider = new EditTextArgumentProvider();

        //必须在构造函数的最后进行调用
        finishInitialize();
    }

    @Override
    protected int getViewType(MultiItemBean itemBean) {
        return itemBean.getItemType();
    }

    @Override
    public void registerItemProvider() {
        mProviderDelegate.registerProvider(mTextArgumentProvider);
        mProviderDelegate.registerProvider(mEditTextArgumentProvider);
    }
}
